<%@page import="cn.jhc.bean.MusicBean"%>
<%@page import="cn.jhc.dao.TitleDAO"%>
<%@page import="cn.jhc.bean.UserBean"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="cn.jhc.dao.ConnectionFactory"%>
<%@page import="java.sql.Connection"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="./css/music.css"></link>
<title>乐谱下载</title>
</head>
<body>
	<div id="wrapper">
		<jsp:include page="./header.jsp"></jsp:include>
		<div id="address">
			<a>当前位置： 乐谱下载</a>
		</div>
		<div id="box">
		<%
			int integral;
			String id = request.getParameter("id");
			int Id = Integer.parseInt(id);
			TitleDAO dao2 = new TitleDAO();
			dao2.setCon(ConnectionFactory.getConnection());
			UserBean user = (UserBean) session.getAttribute("user");
			if (null == user) {
				integral = 0;
			}else{
				int userid = user.getId();
				integral = dao2.showIntegral(userid);
			}
		%>
			<div class="box_a" align="center"><a>本站提供用户吉他乐谱的下载，但下载需要花费用户积分，积分可在讨论区发帖和回帖获取。</a></div>
				<div class="box_search">
			<div class="search1">
			<form method="post" action="./yuepudownload.jsp?search=no">
				<input type="submit" value="返回">
			</form>
			</div>
			<div class="search2">
			<form method="post" action="./searchMusic.do">
				<input type="submit" value="搜索">
				<input type="text" name="title" value=""></input>
			</form>
			</div>
			</div>
		</div>
		<div id="music_image">
				<%
					dao2.setCon(ConnectionFactory.getConnection());
					MusicBean m = dao2.getOneMusic(Id);
					request.setAttribute("onemusic", m);
				%>
				<div id="the_image">
					<div id="kong"></div>
					<div id="image_content"><a>&nbsp;&nbsp;&nbsp;&nbsp;简介：${requestScope.onemusic.content}</a></div>
					<div id="image_down">
						<form method="post" action="download.do">
							<input type="hidden" name="integral" value="<%=integral%>">
							<input type="hidden" name="need_integral" value="${requestScope.onemusic.integral}">
							<input type="hidden" name="imagename" value="${requestScope.onemusic.imagename}">
							<input type="hidden" name="id" value="${requestScope.onemusic.id}">
							<input type="hidden" name="getb" value="/yuepudownload2.jsp">
							<input type="submit" value="点此下载吉他谱">
						</form>
					</div>
					<div id="image_jifeng"><a>此次下载需要积分（${requestScope.onemusic.integral}）</a></div>
					<div id="music_name" align="center"><img src="UserFiles/Image/${requestScope.onemusic.musicname}" width="800"></div>
					<div id="image_bg"></div>
				</div>
		</div>
		<div id="button_bg"></div>
		<div id="line2"></div>
		<div id="copyright">
			<a>&copy;版权所有:蓝调吉他社 </a><a>| </a>
			<div id="admin">
				<a href="houtai_index.jsp">管理员登录</a>
			</div>
		</div>
	</div>
</body>
</html>